<?php
class Pick
{
	/* Pick Class Attributes */
	var $GameNum;
	var $UserPick;
	var $UserID;
	var $Ranking;
	var $Home;
	var $Away;
	var $Winner;
	var $Week;
	var $GameInProgress;
	
	#GameNum,UserPick,UserID,Ranking,Home,Away,Winner,Week,GameInProgress


	//############################################################################
	
	/*
	Function: Pick($GameNum='',$UserID='',$Ranking='',$Home='',$Away='',$Winner='',$Week='',$GameInProgress='')
	Updated: September 14th, 2007
	Description: Pick Class constructor.
	*/	
	function Pick($GameNum='',$UserPick='',$UserID='',$Ranking='',$Home='',$Away='',$Winner='',$Week='',$GameInProgress='')
	{
		$this->GameNum = $GameNum;
		$this->UserPick = $UserPick;
		$this->UserID = $UserID;
		$this->Ranking = $Ranking;
		$this->Home = $Home;
		$this->Away = $Away;
		$this->Winner = $Winner;
		$this->Week = $Week;
		$this->GameInProgress = $GameInProgress;
	}/* End Pick() */
	
	function getRank()
	{
		return $this->Ranking;
	}
   
	//############################################################################
	
	/*
	Function: Display($League)
	Updated: September 14th, 2007
	Description: Displays the Pick attributes for other user to see what the UserID wants,onmouseover=\"ShowContent('PickDescDisplay'); return true;\"
	describe the Pick, where to get the Pick, etc..
	*/	
	function Display($League)
	{		
		echo "<div class=\"Pick\">\n";
			//echo "<form action=\"javascript:get(document.getElementById('PicksForm".$this->GameNum."'));\" name=\"PicksForm".$this->GameNum."\" id=\"PicksForm".$this->GameNum."\">
			echo "
				<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
					<tr>
						<td width=\"20\">".$this->Ranking."</td>
						<td width=\"37\"><img src=\"http://hockey.joshhughes.com/".$League."/images/small/".$this->Away.".gif\" onClick=\"goSet(PicksForm.Game".$this->GameNum.",'".$this->Away."')\"></td>
						<td width=\"75\">".$this->Away."</td>
						<td width=\"25\" align=\"center\"> @ </td>
						<td width=\"75\">".$this->Home."</td>
						<td width=\"37\"><img src=\"http://hockey.joshhughes.com/".$League."/images/small/".$this->Home.".gif\" onClick=\"goSet(PicksForm.Game".$this->GameNum.",'".$this->Home."')\"></td>
						<td width=\"100\">Your pick:</td> 
						<td width=\"100\">";
						if ($this->UserPick != "")
						{	//user has made a pick for this game.
							if($this->GameInProgress == 1)
							{
								if ($this->UserPick == $this->Winner)
									echo "<span style=\"color: #FF0000; font-weight: bold;\">".$this->UserPick."</span></td>";
								else
									echo $this->UserPick."</td>";
							}
							else
							{
								echo "<select name=\"Game".$this->GameNum."\" class=\"select\">";
									if($this->UserPick == $this->Away)
									{
										echo "<option selected value=\"".$this->Away."\">".$this->Away."</option>";
									}
									else
									{
										echo "<option value=\"".$this->Away."\">".$this->Away."</option>";
									}
									if($this->UserPick == $this->Home)
									{
										echo "<option selected value=\"".$this->Home."\">".$this->Home."</option>";
									}
									else
									{
										echo "<option value=\"".$this->Home."\">".$this->Home."</option>";
									}
									echo "</select></td>";
							}
						}
						else
						{
							echo "<select name=\"Game".$this->GameNum."\" class=\"select\" style=\"background-color: #FFFF99;\">
							<option selected value=\"\">Make Pick</option><option value=\"".$this->Away."\">".$this->Away."</option>
							<option value=\"".$this->Home."\">".$this->Home."</option>
							</select></td>";
						}
					echo "
					</tr>
				  </table>";
		echo "</div>\n";

	}/* End Display() */

	//############################################################################
	
	function Delete()
	{
		$Removed = true;
	}
   
   
   
} /* End Pick Class */
?> 